package com.sise.rsc.repository;

import com.sise.rsc.entity.CourierStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

public interface CourierStatusRepository extends JpaRepository<CourierStatus,Integer> {

    @Query("FROM CourierStatus c WHERE c.status=:status and c.time >=:time")
    List<CourierStatus> findCourierStatusesByStatusAndTime(String status, Date time);

    //通过签到状态和快递员ID查找所有签到状态
    @Query("FROM CourierStatus c WHERE c.status=:status and c.courier.id=:id")
    List<CourierStatus> findCourierStatusesByStatusAndCourierId(String status, int id);

    @Query("FROM CourierStatus c WHERE c.time=:time and c.courier.id=:id")
    List<CourierStatus> findCourierStatusesByTimeAnAndCourierId(Date time,int id);
}
